<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>分割字符串</title>
</head>
<body>
	<script type="text/javascript">
		var str="welcome-to-beijing";
		//使用split将str分割成字符串
		var arr=str.split("-");
		console.log(arr);
	</script>
</body>
</html>